package kr.saeildamil.androidstudy_second.br_service;

import kr.saeildamil.andrordstudy.second.R;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.widget.Toast;

public class OnSaveZone extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch2920_onsavezone);
	}
	
	@Override
	//BroadCast Receiver 등록
	protected void onResume() {
		super.onResume();
		IntentFilter filter = new IntentFilter("kr.saeildamil.androidstudy_second.SAVEZONE");
		registerReceiver(mSaveZoneBR, filter);
	}
	
	protected void onPause() {
		super.onPause();
		unregisterReceiver(mSaveZoneBR);
	};
	
	BroadcastReceiver mSaveZoneBR = new BroadcastReceiver() {
		public void onReceive(Context context, Intent intent) {
			Toast.makeText(context, "아싸 공짜다~~", Toast.LENGTH_SHORT).show();
		}
	};
}
